$(function () {
    /**
     * 查询科室信息
     */
    $.ajax({
        url: "../../DropDownBoxQuery/findByhospitalId",
        type: "post",
        dataType: "json",
        success: function (map) {
            var departmentList = map.departmentList;
            var department_select = document.getElementById("sel_dempartment");
            department_select.innerHTML = "<option value=''>请选择</option>";
            //加载
            for (var i = 0; i < departmentList.length; i++) {
                var opt = document.createElement("option");
                opt.innerText = departmentList[i].departmentName;
                opt.setAttribute("value", departmentList[i].departmentId);
                department_select.appendChild(opt);
            }
        },
        error: function () {
            window.location.href = "../../404.jsp";
        }
    });

    /**
     * 查询随访组信息
     */
    $.ajax({
        url: "../../DropDownBoxQuery/findByGrouptable",
        type: "post",
        dataType: "json",
        success: function (map) {
            var grouptableList = map.grouptableList;
            var grouptable_select = document.getElementById("sel_grouptable");
            grouptable_select.innerHTML = "<option value=''>请选择</option>";
            //加载
            for (var i = 0; i < grouptableList.length; i++) {
                var opt = document.createElement("option");
                opt.innerText = grouptableList[i].gname;
                opt.setAttribute("value", grouptableList[i].groupId);
                grouptable_select.appendChild(opt);
            }
        },
        error: function () {
            window.location.href = "../../404.jsp";
        }
    });

})